package com.blm.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.util.unit.DataSize;

@Data
@ConfigurationProperties(prefix = "minio")
public class MinioProperties {
    private String endpoint;
    private String accessKey;
    private String secretKey;
    private String bucketName;
    private DataSize maxFileSize;
    private String prefix;

    public Long getMaxFileSizeInBytes() {
        return maxFileSize == null ? (10 * 1024 * 1024) : maxFileSize.toBytes();
    }
}
